// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.linqingying.gitcode.api.data;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.io.mandatory.RestModel;

import java.util.Objects;


/*
{
  "avatar_url": "https://cdn-img.gitcode.com/fa/be/2fa2be6d3ffd01599dbc0a3c71ee9ec4cadb82f63a7a8489187645064ad95e59.png?time=1694709764757",
  "followers_url": "https://api.gitcode.com/api/v5users/gitcode-xxm/followers",
  "html_url": "https://gitcode.com/gitcode-xxm",
  "id": "64e5ed8f7e20aa73efcbc302",
  "login": "gitcode-xxm",
  "name": "xxm",
  "type": "User",
  "url": "https://api.gitcode.com/api/v5/gitcode-xxm",
  "bio": "a PM ",
  "blog": "https://gitcode.com",
  "company": "",
  "email": "xiongjiamu@163.com",
  "followers": 8,
  "following": 35,
  "top_languages": ["Python", "Markdown", "C++", "C", "HTML"]
}

 */
//endregion
@RestModel

@SuppressWarnings("UnusedDeclaration")

public class GitCodeUser {
    private String login;
    private String id;

    private String avatarUrl;
    private String url;
    private String htmlUrl;
    private String type;



    @NotNull
    public String getLogin() {
        return login;
    }

    @NotNull
    public String getHtmlUrl() {
        return htmlUrl;
    }

    @Nullable
    public String getAvatarUrl() {
        return avatarUrl;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof GitCodeUser user)) return false;
        return id.equals(user.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }
}
